package busserver;

import org.restlet.Application;
import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.data.Protocol;
import org.restlet.routing.Router;

public class BusApplication extends Application {
    @Override
    public synchronized Restlet createInboundRoot() {
        Router router = new Router(this.getContext());
        
        // Inregistreaza resursele.
        router.attach("/station", AllStationsResource.class);
        router.attach("/station/{ID}", StationResource.class);
        router.attach("/bus/{ID}/schedule", BusScheduleResource.class);
        router.attach("/route/{ID}/bus", AllStationsResource.class);
        router.attach("/map", MapResource.class);
        router.attach("/tile/{ID}", TileResource.class);

        
        return router;
    }

    public static DataProvider getProvider() {
        // Returneaza un provider care foloseste baza de date.
        return new db.DBDataProvider();
    }
}
